package cn.tedu.yl.campus.controller;

import cn.tedu.yl.base.response.JsonResult;
import cn.tedu.yl.campus.pojo.dto.CampusQuery;
import cn.tedu.yl.campus.pojo.dto.CampusSaveParam;
import cn.tedu.yl.campus.pojo.vo.CampusVO;
import cn.tedu.yl.campus.service.CampusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;
@RestController
@RequestMapping("/v1/campus")
public class CampusController {
    @Autowired
    private CampusService campusService;

    public JsonResult select(CampusQuery campusQuery){
        List<CampusVO> list = campusService.select(campusQuery);
        return JsonResult.ok(list);
    }

    @PostMapping("save")
    public JsonResult save(CampusSaveParam campusSaveParam ){
       campusService.save(campusSaveParam);
        return JsonResult.ok();
    }

}
